import { history, useIntl } from "@umijs/max";
import { Button, Card, Result } from "antd";
import React from "react";

interface Props {
    title: string;
    CallbackButton?: React.ComponentType;
}

const NoFoundPage: React.FC<Props> = ({ title, CallbackButton }) => (
    <Card variant="borderless">
        <Result
            status="404"
            title="404"
            subTitle={title}
            extra={
                CallbackButton ? <CallbackButton /> : 
                <Button type="primary" onClick={() => history.back()}>
                    返回
                </Button>
            }
        />
    </Card>
);

export default NoFoundPage;